/**
 * created by 小卷毛, 2021/4/7
 * Copyright (c) 2021, 416143467@qq.com All Rights Reserved.
 * #                   *********                            #
 * #                  ************                          #
 * #                  *************                         #
 * #                 **  ***********                        #
 * #                ***  ****** *****                       #
 * #                *** *******   ****                      #
 * #               ***  ********** ****                     #
 * #              ****  *********** ****                    #
 * #            *****   ***********  *****                  #
 * #           ******   *** ********   *****                #
 * #           *****   ***   ********   ******              #
 * #          ******   ***  ***********   ******            #
 * #         ******   **** **************  ******           #
 * #        *******  ********************* *******          #
 * #        *******  ******************************         #
 * #       *******  ****** ***************** *******        #
 * #       *******  ****** ****** *********   ******        #
 * #       *******    **  ******   ******     ******        #
 * #       *******        ******    *****     *****         #
 * #        ******        *****     *****     ****          #
 * #         *****        ****      *****     ***           #
 * #          *****       ***        ***      *             #
 * #            **       ****        ****                   #
 */
package com.example.myapplication

import android.app.Application
import android.util.Log
import com.example.myapplication.util.CrashHandler
import com.xinnuo.analytics.android.SensorsManager

/**
 * 描 述：
 * 作 者：小卷毛  2021-04-07 13:37
 * 修改描述：
 * 修 改 人：
 * 修改版本：
 */
class Application : Application() {

    override fun onCreate() {
        super.onCreate()

        Thread.setDefaultUncaughtExceptionHandler(
            CrashHandler(this.applicationContext)
        )

        SensorsManager
            .instance
            .setOnAppStatusListener(
                onFront = { Log.i("Application", "应用切换到前台") },
                onBack = { Log.i("Application", "应用切换到后台") }
            )
    }

}